import Directies from '@/directive/index';
import route from "@/router/index";
import pinia from '@/store/store';
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css';
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import 'ant-design-vue/es/message/style/css';
import 'ant-design-vue/es/modal/style/css';
import 'babel-polyfill';
import Prism from 'prismjs';
import type { App as tyapp } from 'vue';
import { createApp } from 'vue';
import { Column, Icon, Table, VXETable, VxePager, VxeSelect } from 'vxe-table';
import zhCN from 'vxe-table/es/locale/lang/zh-CN';
import XEUtils from 'xe-utils';
import App from './App.vue';
import './style.css';
VXETable.setup({
  i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args)
})

function useTable (app: tyapp) {
  app.use(Icon)
  .use(Column)
  .use(VxePager)
  .use(VxeSelect)
  .use(Table)
}

VueMarkdownEditor.use(vuepressTheme, {
  Prism,
})
VueMarkdownEditor.use(createCopyCodePlugin());

createApp(App).use(useTable).use(route).use(pinia).use(Directies).use(VueMarkdownEditor).mount('#app')
